package cn.xshi.oauth.service.impl;
import java.util.List;
import java.util.Map;

import cn.xshi.oauth.dao.OauthFunctionRoleDao;
import cn.xshi.oauth.model.OauthFunctionRole;
import cn.xshi.oauth.service.OauthFunctionRoleService;
import cn.xshi.common.base.BaseService;
import cn.xshi.common.util.ExceptionUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
/**
 * @Desc 授权中心功能对角色
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class OauthFunctionRoleServiceImpl extends BaseService implements OauthFunctionRoleService {

	@Resource
	private OauthFunctionRoleDao oauthFunctionRoleDao;

	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<OauthFunctionRole> getOauthFunctionRoleListByCondition(Map<String,Object> condition){
		try{
			return oauthFunctionRoleDao.getOauthFunctionRoleListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}

	/**
	* 添加
	* @param oauthFunctionRole 
	* @return
	*/
	public int addOauthFunctionRole(OauthFunctionRole oauthFunctionRole){
		int i = 0;
		try {
			i = oauthFunctionRoleDao.addOauthFunctionRole(oauthFunctionRole);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
